/*
 * Records package
 */
package edu.gatech.oad.records;
import edu.gatech.oad.doctorsorder.DoctorsOrder;
import edu.gatech.oad.persistence.PersistentObject;
import edu.gatech.oad.schedule.Appointment;
import edu.gatech.oad.user.Doctor;
import edu.gatech.oad.user.Nurse;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 *Represents a standard record for each doctor visit
 *@author Nathan Hurley
 *@version 1.0
 */
public class TreatmentRecord extends PersistentObject{
	/**
	 * Serializable variable
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * height of the Patient 
	 */
	private String height;
	
	/**
	 * weight of the Patient
	 */
	private String weight;
	
	/**
	 * temperature of the Patient
	 */
	private String temperature;
	
	/**
	 * Patient's pule
	 */
	private String pulse;
	
	/**
	 * Systolic blood pressure
	 */
	private String systolicBloodPressure;
	
	/**
	 * diastolic blood pressure
	 */
	private String diastolicBloodPressure;
	
	/**
	 * Symptoms from this visit
	 */
	private String symptoms;
	
	/**
	 * Diagnosis from current treatment
	 */
	private String diagnosis;
	
	/**
	 * Other notes made by physician
	 */
	private String notes;
	
	/**
	 * Cost of the treatment
	 */
	private double cost;
	
	/**
	 * Appointment used to create this
	 */
	private Appointment curAppointment;
	
	/**
	 * The Invoice associated with the record
	 */
	private Invoice curInvoice;
	
	/**
	 * Doctors Orders including LabOrders and Prescriptions
	 */
	private final List<DoctorsOrder> orders;
	
	/**
	 * Attending Doctor for this treatment
	 */
	private Doctor attendingDoctor;
	
	/**
	 * Attending nurse for this treatment
	 */
	private Nurse attendingNurse;
	
	/**
	 * Default constructor for the TreatmentRecord class. Initializes instance variables.
	 * @param curAppointment Appointment associated with TreatmentRecord
	 */
	public TreatmentRecord(Appointment curAppointment){
		this.curAppointment = curAppointment;
		attendingDoctor = curAppointment.getDoctor();
		orders = new ArrayList<DoctorsOrder>();
		height = "";
		weight = "";
		temperature = "";
		systolicBloodPressure = "";
		diastolicBloodPressure = "";
		pulse = "";
	}
	
	/**
	 * @param curInvoice  the new Invoice
	 */
	public void setInvoice(Invoice curInvoice){
		this.curInvoice = curInvoice;
	}
	
	/**
	 * @return  the current Invoice
	 */
	public Invoice getInvoice(){
		return curInvoice;
	}
	
	/**
	 * @param height  the new height
	 */
	public void setHeight(String height){
		this.height = height;
	}
	
	/**
	 * @return  the patients height
	 */
	public String getHeight(){
		return height;
	}
	
	/**
	 * @param weight  the new weight
	 */
	public void setWeight(String weight){
		this.weight = weight;
	}
	
	/**
	 * @return  the patients weight
	 */
	public String getWeight(){
		return weight;
	}
	
	/**
	 * @param temperature  the new temperature
	 */
	public void setTemperature(String temperature){
		this.temperature = temperature;
	}
	
	/**
	 * @return  the patients temperature
	 */
	public String getTemperature(){
		return temperature;
	}
	
	/**
	 * @param pulse  the new pulse
	 */
	public void setPulse(String pulse){
		this.pulse = pulse;
	}
	
	/**
	 * @return  the patients pulse
	 */
	public String getPulse(){
		return pulse;
	}
	
	/**
	 * @param systolicBloodPressure  the new systolic blood pressure
	 */
	public void setSystolicBloodPressure(String systolicBloodPressure){
		this.systolicBloodPressure = systolicBloodPressure;
	}
	
	/**
	 * @return  the patients systolic blood pressure
	 */
	public String getSystolicBloodPressure(){
		return systolicBloodPressure;
	}
	
	/**
	 * @param diastolicBloodPressure  the new diastolic blood pressure
	 */
	public void setDiastolicBloodPressure(String diastolicBloodPressure){
		this.diastolicBloodPressure = diastolicBloodPressure;
	}
	
	/**
	 * @return  the patients diastolic blood pressure
	 */
	public String getDiastolicBloodPressure(){
		return diastolicBloodPressure;
	}
	
	/**
	 * @param symptoms  patients new symptoms
	 */
	public void setSymptoms(String symptoms){
		this.symptoms = symptoms;
	}
	
	/**
	 * @return  patients symptoms
	 */
	public String getSymptoms(){
		return symptoms;
	}
	
	/**
	 * @param diagnosis  the new diagnosis
	 */
	public void setDiagnosis(String diagnosis){
		this.diagnosis = diagnosis;
	}
	
	/**
	 * @return  doctors diagnosis of the patient
	 */
	public String getDiagnosis(){
		return diagnosis;
	}
	
	/**
	 * @param notes  the new notes
	 */
	public void setNotes(String notes){
		this.notes = notes;
	}
	
	/**
	 * @return  the doctors notes
	 */
	public String getNotes(){
		return notes;
	}
	
	/**
	 * @return  cost of the treatment
	 */
	public double getCost(){
		return cost;
	}
	
	/**
	 * @param cost  the new cost of the treatment
	 */
	public void setCost(double cost){
		this.cost = cost;
	}
	
	/**
	 * @param curAppointment  the new appointment
	 */
	public void setAppointment(Appointment curAppointment){
		this.curAppointment = curAppointment;
	}
	
	/**
	 * @return  the patients appointment
	 */
	public Appointment getAppointment(){
		return curAppointment;
	}
	
	/**
	 * @return  the Date of the treatment
	 */
	public Date getDate(){
		return curAppointment.getDate();
	}
	
	/**
	 * @return returns the date of the TreatmentRecord
	 */
	public String toString(){
		return getDate().toString();
	}
	
	/**
	 * @param newOrder adds DoctorsOrder to orders
	 */
	public void addDoctorsOrder(DoctorsOrder newOrder){
		orders.add(newOrder);
	}
	
	/**
	 * @param toRemove the DoctorsOrder to remove
	 */
	public void removeDoctorsOrder(DoctorsOrder toRemove){
		orders.remove(toRemove);
	}
	
	/**
	 * @return the List of DoctorsOrders
	 */
	public List<DoctorsOrder> getDoctorsOrders(){
		return orders;
	}
	
	/**
	 * @param attendingDoctor the new Doctor for this treatment
	 */
	public void setAttendingDoctor(Doctor attendingDoctor){
		this.attendingDoctor = attendingDoctor;
	}
	
	/**
	 * @return the attending Doctor for this treatment
	 */
	public Doctor getAttendingDoctor(){
		return attendingDoctor;
	}
	
	/**
	 * @param attendingNurse new attending Nurse for this treatment
	 */
	public void setAttendingNurse(Nurse attendingNurse){
		this.attendingNurse = attendingNurse;
	}
	
	/**
	 * @return the attending Nurse for this treatment
	 */
	public Nurse getAttendingNurse(){
		return attendingNurse;
	}
	
	/*public boolean equals(Object o){
		if(o instanceof TreatmentRecord){
			TreatmentRecord t = (TreatmentRecord) o;
			if(t.getHeight().equals(this.getHeight()) && 
				t.getWeight().equals(this.getWeight()))
				return true;
		}
		return false;
	}*/
	
}
